package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	//counts := make(map[string]int)
	var counts map[string]int
	inputScanner := bufio.NewScanner(os.Stdin)

	for inputScanner.Scan() {
		counts[inputScanner.Text()]++
	}

	// key 是字符串，value 是该串出现的次数
	for key, value := range counts {
		if value > 1 {
			fmt.Printf("%3d %s\n", value, key)
		}
	}
}
